<!DOCTYPE html>
<html>

<body>
<div th:fragment="header">
    <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <div class="container-fluid">
            <a class="navbar-brand" href="/">WrongSecrets</a>
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse"
                    data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent"
                    aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>

            <div class="collapse navbar-collapse" id="navbarSupportedContent">
                <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                    <li class="nav-item">
                        <a th:class="'nav-link '+${requestURI == '/' ? 'active' : ''}"
                           href="/">Home</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a th:class="'nav-link dropdown-toggle '+${requestURI.contains('challenge') ? 'active' : ''}"
                           href="#" id="navbarDropdown" role="button"
                           data-bs-toggle="dropdown" aria-expanded="false">
                            Challenges
                        </a>
                        <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                            <!--/*@thymesVar id="challenges" type="java.util.List<org.owasp.wrongsecrets.challenges.ChallengeUI>"*/-->
                            <span th:each="challenge : ${challenges}" th:remove="tag">
                                <a class="dropdown-item" th:href="'/challenge/' + ${challenge.link}"><span
                                    th:text="${challenge.name}" th:remove="tag"></span></a>
                            </span>
                        </ul>
                    </li>
                    <li class="nav-item">
                        <a href="https://github.com/OWASP/wrongsecrets"
                           class="nav-link" target="_blank">Github</a>
                    </li>
                    <li class="nav-item">
                        <a th:class="'nav-link '+${requestURI == '/stats' ? 'active' : ''}"
                           href="/stats">Stats</a>
                    </li>
                    <li class="nav-item dropdown">
                        <a th:class="'nav-link '+${requestURI == '/about' ? 'active' : ''}"
                           href="/stats" role="button"
                           data-bs-toggle="dropdown" aria-expanded="false">About</a>
                        <ul class="dropdown-menu" aria-labelledby="navbarDropdown">
                            <a class="dropdown-item" href="https://owasp.org/www-project-wrongsecrets/"
                               target="_blank">OWASP</a>
                            <a class="dropdown-item" href="/about">About</a>
                        </ul>
                    </li>
                    <div class="theme-switch toggle-button mt-10" th:attr="data-cy='dark-mode-radio'">
                        <label for="theme-toggle" id="theme-toggle-label" onclick="toggleTheme()">☀</label>
                        <input type="checkbox" id="theme-toggle" class="theme-toggle" hidden>
                    </div>
                </ul>
                <a th:if="${ctf_enabled != null && ctf_enabled == true}" class="nav-link disabled me-2" href="#"
                   tabindex="-1" aria-disabled="true" style="color:white">In CTF-mode</a>
                <a class="nav-link disabled me-2" href="#" tabindex="-1" aria-disabled="true"
                   th:text="'Environment: '+${environment}" style="color:white"></a>
                <a class="nav-link disabled me-2" href="#" tabindex="-1" aria-disabled="true"
                   th:text="'Version: '+${version}" style="color:white"></a>
            </div>
        </div>
    </nav>
</div>
</body>

</html>
